//////////////////////////////////////////////////////////////////////////
//
// Vector Graph Core2D
//
// Module:
//        ElementTrait.cs
//
// Description:
//        Provides decoration information for drawing elements
//
// Author:
//        Created on 2008.04.14 by Destrayer
//
//////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace VectorGraph.Core2D
{
    class ElementTrait2D
    {
        private Color color;
        private float width;
        private DashStyle style;

        #region properties
        public Color DrawColor
        {
            get { return this.color; }
            set { this.color = value; }
        }

        public float Width
        {
            get { return this.width; }
            set { this.width = value; }
        }

        public DashStyle Style
        {
            get { return this.style; }
            set { this.style = value; }
        }
        #endregion

        public ElementTrait2D(Color color, float width, DashStyle style)
        {
            this.color = color;
            this.width = width;
            this.style = style;
        }

        public ElementTrait2D()
            : this(Color.Red, 0.3f, DashStyle.Solid)
        {
        }

        public Pen GetDrawPen()
        {
            Pen pen = new Pen(this.color, this.width);
            pen.DashStyle = this.style;
            return pen;
        }

        public Brush GetDrawBrush()
        {
            return new SolidBrush(this.color);
        }
    }
}
